﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CommonList.aspx.cs" ValidateRequest="false"   Inherits="TaoSH.View.CommonList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

    <link rel="stylesheet" href="../../CSS/bootstrap3.2/css/bootstrap.css" />

</head>
<body>
    <form id="form1" runat="server">
        <div class="container-fluid maindiv" style="margin-top: 20px" id="dvContent">
            <asp:PlaceHolder runat="server" ID="QueryCon" />
            

            <div class="panel panel-default">
                <!-- Default panel contents -->
                <div class="panel-heading" style="display:none">数据列表</div>

                <!-- Table -->
                <table id="FTGrid">
                </table>
                <div class="panel-footer">
                    <div class="form-group" style="margin-bottom: 0px; text-align: right">
                        <div class="input-group">
                            <div class="input-group-addon">共找到<span class="text-info" id="spDataCount"></span>条记录,当前显示页码</div>
                            <asp:DropDownList runat="server" CssClass="form-control" Width="100px" ID="ddlPageIndex"   AutoPostBack="true" OnSelectedIndexChanged="ddlPageIndex_SelectedIndexChanged">
                                <asp:ListItem Value="1" />
                            </asp:DropDownList>
                        </div>
                    </div>
                </div>

            </div>
            <input type="hidden" id="tabledata" value="" runat="server" />
            <input type="hidden" id="hidselID" value="" runat="server" />
            <input type="hidden" id="hidDataCount" value="" runat="server" />
            <input type="hidden" id="hidPageLen" value="10" runat="server" />
            <input type="hidden" id="hidQueryWhere" value="" runat="server" />

        </div>
    </form>
    <script type="text/javascript" src="../../Scripts/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="../../Scripts/json2.js"></script>
    <script type="text/javascript" src='../../JqueryPlug/lhgdialog/lhgdialog.js?skin=discuz'></script>
    <script type="text/javascript" src="../../JqueryPlug/Toast/toastr.js"></script>
    <script type="text/javascript" src="../../Scripts/YanTable.js"></script>
        <script type="text/javascript" src="../../JqueryPlug/YanTip/YanTip.js"></script>

    <script type="text/javascript" src="../../Scripts/B2CCommon.js"></script>
    <script type="text/javascript">
        var YanTab;
        $(document).ready(function () {
            var tabledata = $("#tabledata").val();
            $("#spDataCount").text($("#hidDataCount").val());
            var FormCode = ComFunJS.getQueryString("FormCode");
            var jspath = "../../View/JSList/" + FormCode + ".js";
            $.getScript(jspath, function () {

                 YanTab = $("#FTGrid").YanTable({
                    datasource: jQuery.parseJSON(tabledata),//jsondata
                    columns: option.columns,
                    rowclick: function ($tr) {
                        $("#hidselID").val($tr.attr("dataid"));
                    }
                });
            });

          
            $("#addForm").click(function () {
                MyDialog.viewform("Comon/CommonAdd.aspx?FormCode=" + FormCode, "添加数据");
               //parent.addNewTab("Comon/CommonAdd.aspx?FormCode=" + FormCode, FormCode, "添加数据")

            })

            $("#EditForm").click(function () {
                var FormID = $("#hidselID").val();
                if (FormID != "") {
                    parent.addNewTab("Comon/CommonUpdate.aspx?FormCode=" + FormCode + "&FormID=" + FormID, FormCode+FormID, "编辑数据")
                } else {
                    toastr.warning("请先选择一条记录");
                }
            })
            $("#DelForm").click(function () {
                var FormID = $("#hidselID").val();
                if (FormID == "") {
                    toastr.warning("请先选择一条记录");
                }
            })
        });
    </script>
</body>
</html>

